Streaming media is a continuous time-based media using streaming transmission technology in the Internet, such as audio, video or multimedia files. Streaming media does not download the whole file before playing, only store beginning partial contents into a RAM. Data streams of the streaming media can be transmitted at any time and then broadcast at any time, and only a certain delay exists at the beginning. Streaming transmission technology is the key technology for the implementation of streaming media.
Nowadays, high definition (HD) video transmission using streaming transmission technology is becoming more and more popular in the field of real-time video surveillance. To ensure the transmission of HD videos, a larger network bandwidth and a more stable network transmission environment are often required. However, in a public network environment, especially in a mobile wireless network, the network environment is dynamically changed. In a dynamically changing network environment, the realization of HD video transmission requires to timely reduce the encoding rate of transmission in case of an insufficient bandwidth, to timely return to the previous encoding rate during normal transmission when the bandwidth is recovered, to quickly perform retransmission in case of packet loss, and to reduce transmission rate jitter in case of network delay jitter. To sum up, in a dynamically changing network environment, it is necessary to meet the requirements of transmission control and network bandwidth self-adaption to achieve HD video transmission.
In the aspect of transmission control, few references are available in the prior art. As everyone knows, in an IP-based network transmission mode, selectable transport layer protocols are only TCP (Transmission Control Protocol, which is a transport layer protocol in the framework of the TCP/IP protocol, and provides reliable connection-oriented transmission) and UDP (User Datagram Protocol, which is a transport layer protocol in the framework of the TCP/IP protocol, and provides unreliable transmission), but which transmission protocol to be used is rarely mentioned in the prior art. If the TCP protocol is used, the transmission rate will be reduced rapidly when packet loss occurs in the network, which has a great impact on surveillance video applications which require real-time transmission. Even if the transmission rate can be quickly recovered using an improved algorithm for the TCP protocol, the increase and decrease of the bit stream transmission rate will occur inevitably, affecting video playing effect. If UDP protocol is used, it is necessary to guarantee the reliability of network transmission.
In the aspect of network bandwidth self-adaption, two kinds of solutions are mainly included in the prior art. One solution is based on the change of a sending buffer: when the network bandwidth becomes smaller, the sending buffer is also getting smaller, and then the encoding rate is reduced. However, after the encoding rate is reduced, the size of the sending buffer will theoretically be close to zero. If the network bandwidth increases again over time, such methods cannot determine the appropriate time to correspondingly increase the encoding rate. Moreover, in a public network, especially in a wireless network, delay jitter or even packet loss occurs very often, which will have a significant impact on the sending buffer. For example, for an encoding rate of 4 Mbps and a sending buffer of 4 Mb, a sporadic delay of one second in a network can make the sending buffer full, and it is obviously inappropriate to further reduce the encoding rate at this time. The other solution is to adjust the encoding rate according to the change of the network bandwidth. However, how to evaluate the current network bandwidth is not disclosed explicitly in the prior art.
In existing network technologies for transmitting real-time videos, it is not inconceivable to adjust the encoding rate according to the change of the network bandwidth. When the network bandwidth is less than the encoding rate, it is easy to get the conclusion that the encoding rate should be reduced, according to the actual amount of transmission. However, after the reduction, if the network bandwidth is getting better, it is hard to figure out what the current network bandwidth actually is after the network bandwidth becomes better because the encoding rate is constant. If the encoding rate is gradually increased in a tentative manner, the network bandwidth must oscillate back and forth around a critical network bandwidth, which leads to a poor display effect finally presented to users. Therefore, how to calculate the actual network bandwidth according to the characteristics of real-time packet generation and transmission is a technical problem required to be solved.